<admintpl file="header" />
	<style>
		.center {
			text-align: center!important;
		}
	</style>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:U('Lesson/Adminlesson/subject_lists')}" target="_self">专题列表</a></li>
			<li><a href="{:U('Lesson/Adminlesson/edit_lesson_subject', ['id' => $subject_id])}" target="_self">编辑专题</a></li>
			<li class="active"><a href="javascript:;">兑换码列表</a></li>
		</ul>
		<form class="js-ajax-form" action="" method="post">
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="50">ID</th>
						<th width="150">兑换码</th>
						<th width="50">折扣</th>
						<th width="50">使用者id</th>
						<th width="50">使用时间</th>
						<th width="50">创建时间</th>
						<th width="50">编辑</th>
					</tr>
				</thead>
				<foreach name="lists" item="vo">
					<tr>
						<td>{$vo.id}</td>
						<td style="font-size: 14px;">{$vo.code}</td>
						<td>{$vo.discount} 折</td>
						<td>{$vo.user_id}</td>
						<td>{$vo['use_time'] > 0 ? date("Y-m-d H:i:s", $vo['use_time']) : 0}</td>
						<td>{:date("Y-m-d H:i:s", $vo['created_at'])}</td>
						<td>
							<if condition="$vo['use_time'] == 0">
								<a href="{:U('Lesson/Adminlesson/delete_redeem_code',array('id' => $vo['id']))}" class="js-ajax-delete">删除</a>
							</if>
						</td>
					</tr>
				</foreach>
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		$(document).ready(function () {
        })
	</script>
</body>
</html>